<?php
class WebFragmentModel extends Model {
	var $_table = 'web_fragment';
	
	var $fragment_id_nak; //INT UNSIGNED NOT NULL AUTO_INCREMENT,
	var $create_time_T; //INT UNSIGNED NOT NULL DEFAULT 0,
	var $create_uid_nr = 0; //INT UNSIGNED NOT NULL DEFAULT 0,
	var $update_time_uT; //INT UNSIGNED NOT NULL DEFAULT 0,
	var $update_uid_nr = 0; //INT UNSIGNED NOT NULL DEFAULT 0,
	var $name_sr; //VARCHAR(32) NOT NULL COMMENT '块名称,模板中引用',
	var $title_sr; //VARCHAR(32) NOT NULL COMMENT '块标题',
	var $note_s = ''; //VARCHAR(256) NULL COMMENT '描述，说明该块的作用',
	var $fragment_s = ''; //TEXT NULL COMMENT '块内容',
	

	function check_name($value, $data) {
		$where ['name'] = $value;
		if (! empty ( $data ['fragment_id'] )) {
			$where ['fragment_id !='] = $data ['fragment_id'];
		}
		return $this->exist ( $where ) ? "代码片断标识已经存在" : true;
	}

}